<template>
<el-select v-model="value" placeholder="请选择" filterable @change="change">
  <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</template>

<script>
import {
  mapGetters
} from 'vuex'

export default {
  name: 'selectGroup',
  props: {
    newValue: {
      type: [String, Number],
      default: ''
    },
    options: {
      type: Array,
      default: []
    }
  },
  computed: {
    ...mapGetters([
      'menuDetails',
      'menuDialogSelect'
    ])
  },
  data() {
    return {
      value: this.newValue
    }
  },
  methods: {
    change(value) {
      this.$emit('select', value)
    }
  },
  watch: {
    newValue(newVal) {
      this.value = newVal
    }
  }
}
</script>

<style lang="css">
</style>
